/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package glamourbeautyclinic.cashier;



import java.awt.Dimension;
import java.awt.Toolkit;
import images.GlamourImage;
import java.awt.Point;
import java.util.Vector;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.RowSorter;
import javax.swing.table.TableModel;
import javax.swing.table.TableRowSorter;
import util.DBConnection;




/**
 *
 * @author anh
 */
public class FrmSearchBill extends javax.swing.JInternalFrame {
    //Declare for EVERY form
    GlamourImage GI = new GlamourImage();
    //Declare for CONCRETE form
    
    
    /**
     * Creates new form frmSearchCustomer
     */
    public FrmSearchBill(DBConnection dc) {
        //this.setContentPane(new ImageBackgroundPanel(new ImageIcon(GI.getClass().getResource("Frame.png"))));
        initComponents();
        
        GI.addIconFor(this);
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        // Can be resize height parameter to proper scale
        this.setLocation((screenSize.width - this.getWidth()) / 2-100, 10);
        RowSorter<TableModel> sorter = new TableRowSorter<TableModel>(tblBill.getModel());
        tblBill.setRowSorter(sorter);
    }


    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        grpComp = new javax.swing.ButtonGroup();
        pmnBillSearch = new javax.swing.JPopupMenu();
        mniSelectAll = new javax.swing.JMenuItem();
        mniDeselect = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mniDelete = new javax.swing.JMenuItem();
        pnlLookup = new javax.swing.JPanel();
        jPanel4 = new javax.swing.JPanel();
        btnSelectAll = new javax.swing.JButton();
        btnDeselect = new javax.swing.JButton();
        btnDelete = new javax.swing.JButton();
        jspBill = new javax.swing.JScrollPane();
        tblBill = new javax.swing.JTable();
        chkToday = new javax.swing.JCheckBox();
        lblFrom = new javax.swing.JLabel();
        calFrom = new org.freixas.jcalendar.JCalendarCombo();
        lblTo = new javax.swing.JLabel();
        calTo = new org.freixas.jcalendar.JCalendarCombo();
        chkAmount = new javax.swing.JCheckBox();
        lblGreater = new javax.swing.JLabel();
        txtGreater = new javax.swing.JTextField();
        radAnd = new javax.swing.JRadioButton();
        radOr = new javax.swing.JRadioButton();
        lblLess = new javax.swing.JLabel();
        txtLess = new javax.swing.JTextField();
        chkCustID = new javax.swing.JCheckBox();
        txtCustID = new javax.swing.JTextField();
        btnSearch = new javax.swing.JButton();
        btnExit = new javax.swing.JButton();

        mniSelectAll.setText("Select all");
        pmnBillSearch.add(mniSelectAll);

        mniDeselect.setText("Deselect");
        pmnBillSearch.add(mniDeselect);
        pmnBillSearch.add(jSeparator1);

        mniDelete.setText("Delete");
        pmnBillSearch.add(mniDelete);

        setClosable(true);
        setIconifiable(true);
        setTitle("Search bill");
        setMaximumSize(new java.awt.Dimension(672, 634));

        pnlLookup.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true), "Search", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 12), new java.awt.Color(51, 51, 51))); // NOI18N
        pnlLookup.setOpaque(false);

        jPanel4.setBackground(new java.awt.Color(255, 255, 255));
        jPanel4.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));

        btnSelectAll.setBackground(new java.awt.Color(255, 255, 255));
        btnSelectAll.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnSelectAll.setForeground(new java.awt.Color(0, 51, 51));
        btnSelectAll.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/SelectAll.png"))); // NOI18N
        btnSelectAll.setMnemonic('a');
        btnSelectAll.setText("Select all");
        btnSelectAll.setToolTipText("Check all select combo box");
        btnSelectAll.setBorder(null);
        btnSelectAll.setContentAreaFilled(false);
        btnSelectAll.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSelectAll.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnSelectAll.setName(""); // NOI18N
        btnSelectAll.setOpaque(true);
        btnSelectAll.setPreferredSize(new java.awt.Dimension(59, 22));
        btnSelectAll.setRolloverEnabled(false);

        btnDeselect.setBackground(new java.awt.Color(255, 255, 255));
        btnDeselect.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnDeselect.setForeground(new java.awt.Color(0, 51, 51));
        btnDeselect.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Deselect.png"))); // NOI18N
        btnDeselect.setMnemonic('e');
        btnDeselect.setText("Deselect");
        btnDeselect.setToolTipText("Uncheck all select combo box");
        btnDeselect.setBorder(null);
        btnDeselect.setContentAreaFilled(false);
        btnDeselect.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnDeselect.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnDeselect.setName(""); // NOI18N
        btnDeselect.setOpaque(true);
        btnDeselect.setPreferredSize(new java.awt.Dimension(59, 22));
        btnDeselect.setRolloverEnabled(false);

        btnDelete.setBackground(new java.awt.Color(255, 255, 255));
        btnDelete.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnDelete.setForeground(new java.awt.Color(0, 51, 51));
        btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Delete.png"))); // NOI18N
        btnDelete.setMnemonic('S');
        btnDelete.setText("Delete");
        btnDelete.setToolTipText("Find customer");
        btnDelete.setBorder(null);
        btnDelete.setContentAreaFilled(false);
        btnDelete.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnDelete.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnDelete.setName(""); // NOI18N
        btnDelete.setOpaque(true);
        btnDelete.setPreferredSize(new java.awt.Dimension(100, 22));
        btnDelete.setRolloverEnabled(false);

        tblBill.setForeground(new java.awt.Color(0, 102, 51));
        tblBill.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, "01/01/1984", "Sarah Bora", "Hair dye"},
                {null, "02/02/2001", "Linsey Lohan", "Hair wash"},
                {null, "04/05/1789", "Amatuer Glassy", "Waxing"}
            },
            new String [] {
                "Select", "Bill date", "Customer name", "Total amount"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Boolean.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                true, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tblBill.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        tblBill.getTableHeader().setReorderingAllowed(false);
        tblBill.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mousePressed(java.awt.event.MouseEvent evt) {
                tblBillMousePressed(evt);
            }
        });
        jspBill.setViewportView(tblBill);
        if (tblBill.getColumnModel().getColumnCount() > 0) {
            tblBill.getColumnModel().getColumn(0).setPreferredWidth(40);
            tblBill.getColumnModel().getColumn(1).setResizable(false);
        }

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jspBill)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(btnSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnDeselect, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnSelectAll, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnDeselect, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jspBill, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                .addContainerGap())
        );

        chkToday.setForeground(new java.awt.Color(0, 102, 51));
        chkToday.setSelected(true);
        chkToday.setText("Today");
        chkToday.setBorder(null);
        chkToday.setBorderPainted(true);
        chkToday.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        chkToday.setOpaque(false);
        chkToday.setPreferredSize(new java.awt.Dimension(51, 20));

        lblFrom.setDisplayedMnemonic('r');
        lblFrom.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblFrom.setForeground(new java.awt.Color(0, 51, 255));
        lblFrom.setText("From");
        lblFrom.setPreferredSize(new java.awt.Dimension(38, 20));

        calFrom.setEnabled(false);

        lblTo.setDisplayedMnemonic('r');
        lblTo.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblTo.setForeground(new java.awt.Color(0, 51, 255));
        lblTo.setText("To");
        lblTo.setPreferredSize(new java.awt.Dimension(38, 20));

        calTo.setEnabled(false);

        chkAmount.setForeground(new java.awt.Color(0, 102, 51));
        chkAmount.setText("Total amount");
        chkAmount.setBorder(null);
        chkAmount.setBorderPainted(true);
        chkAmount.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        chkAmount.setOpaque(false);
        chkAmount.setPreferredSize(new java.awt.Dimension(51, 20));

        lblGreater.setDisplayedMnemonic('r');
        lblGreater.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblGreater.setForeground(new java.awt.Color(0, 51, 255));
        lblGreater.setText("Greater than");
        lblGreater.setPreferredSize(new java.awt.Dimension(38, 20));

        txtGreater.setForeground(new java.awt.Color(0, 102, 51));
        txtGreater.setEnabled(false);
        txtGreater.setPreferredSize(new java.awt.Dimension(56, 20));

        grpComp.add(radAnd);
        radAnd.setSelected(true);
        radAnd.setText("And");
        radAnd.setEnabled(false);
        radAnd.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);

        grpComp.add(radOr);
        radOr.setText("Or");
        radOr.setEnabled(false);
        radOr.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);

        lblLess.setDisplayedMnemonic('r');
        lblLess.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        lblLess.setForeground(new java.awt.Color(0, 51, 255));
        lblLess.setText("Less than");
        lblLess.setPreferredSize(new java.awt.Dimension(38, 20));

        txtLess.setForeground(new java.awt.Color(0, 102, 51));
        txtLess.setEnabled(false);
        txtLess.setPreferredSize(new java.awt.Dimension(56, 20));

        chkCustID.setForeground(new java.awt.Color(0, 102, 51));
        chkCustID.setText("Cust ID");
        chkCustID.setBorder(null);
        chkCustID.setBorderPainted(true);
        chkCustID.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        chkCustID.setOpaque(false);
        chkCustID.setPreferredSize(new java.awt.Dimension(51, 20));

        txtCustID.setForeground(new java.awt.Color(0, 102, 51));
        txtCustID.setEnabled(false);
        txtCustID.setPreferredSize(new java.awt.Dimension(56, 20));

        btnSearch.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnSearch.setForeground(new java.awt.Color(0, 51, 51));
        btnSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Search.png"))); // NOI18N
        btnSearch.setMnemonic('S');
        btnSearch.setText("Search");
        btnSearch.setToolTipText("Find staff");
        btnSearch.setBorder(null);
        btnSearch.setContentAreaFilled(false);
        btnSearch.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnSearch.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnSearch.setName(""); // NOI18N
        btnSearch.setOpaque(true);
        btnSearch.setPreferredSize(new java.awt.Dimension(59, 22));
        btnSearch.setRolloverEnabled(false);

        javax.swing.GroupLayout pnlLookupLayout = new javax.swing.GroupLayout(pnlLookup);
        pnlLookup.setLayout(pnlLookupLayout);
        pnlLookupLayout.setHorizontalGroup(
            pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlLookupLayout.createSequentialGroup()
                .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlLookupLayout.createSequentialGroup()
                        .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlLookupLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(pnlLookupLayout.createSequentialGroup()
                                        .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addGroup(pnlLookupLayout.createSequentialGroup()
                                                .addComponent(chkToday, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(37, 37, 37)
                                                .addComponent(lblFrom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                            .addGroup(pnlLookupLayout.createSequentialGroup()
                                                .addComponent(chkAmount, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(lblGreater, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(calFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(pnlLookupLayout.createSequentialGroup()
                                                .addComponent(txtGreater, javax.swing.GroupLayout.PREFERRED_SIZE, 94, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(radAnd)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(radOr))))
                                    .addGroup(pnlLookupLayout.createSequentialGroup()
                                        .addComponent(txtCustID, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(90, 90, 90)))
                                .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(pnlLookupLayout.createSequentialGroup()
                                        .addComponent(lblTo, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(calTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(btnSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGroup(pnlLookupLayout.createSequentialGroup()
                                            .addComponent(lblLess, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(txtLess, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                            .addGroup(pnlLookupLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(chkCustID, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(pnlLookupLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlLookupLayout.setVerticalGroup(
            pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlLookupLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkToday, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(calFrom, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(calTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkAmount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblGreater, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtGreater, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(radAnd)
                    .addComponent(radOr)
                    .addComponent(lblLess, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtLess, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlLookupLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkCustID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtCustID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        btnExit.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        btnExit.setForeground(new java.awt.Color(0, 51, 51));
        btnExit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/quit.png"))); // NOI18N
        btnExit.setMnemonic('x');
        btnExit.setText("Exit");
        btnExit.setToolTipText("Close window");
        btnExit.setBorder(null);
        btnExit.setContentAreaFilled(false);
        btnExit.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnExit.setMargin(new java.awt.Insets(6, 6, 6, 6));
        btnExit.setName(""); // NOI18N
        btnExit.setOpaque(true);
        btnExit.setPreferredSize(new java.awt.Dimension(59, 22));
        btnExit.setRolloverEnabled(false);
        btnExit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnExitActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(pnlLookup, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(265, 265, 265)
                        .addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(pnlLookup, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnExit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnExitActionPerformed
        this.dispose();
    }//GEN-LAST:event_btnExitActionPerformed

    private void tblBillMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tblBillMousePressed
        Point point = evt.getPoint();
        int currentRow = tblBill.rowAtPoint(point);
        tblBill.setRowSelectionInterval(currentRow, currentRow);
    }//GEN-LAST:event_tblBillMousePressed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnDelete;
    private javax.swing.JButton btnDeselect;
    private javax.swing.JButton btnExit;
    private javax.swing.JButton btnSearch;
    private javax.swing.JButton btnSelectAll;
    private org.freixas.jcalendar.JCalendarCombo calFrom;
    private org.freixas.jcalendar.JCalendarCombo calTo;
    private javax.swing.JCheckBox chkAmount;
    private javax.swing.JCheckBox chkCustID;
    private javax.swing.JCheckBox chkToday;
    private javax.swing.ButtonGroup grpComp;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JScrollPane jspBill;
    private javax.swing.JLabel lblFrom;
    private javax.swing.JLabel lblGreater;
    private javax.swing.JLabel lblLess;
    private javax.swing.JLabel lblTo;
    private javax.swing.JMenuItem mniDelete;
    private javax.swing.JMenuItem mniDeselect;
    private javax.swing.JMenuItem mniSelectAll;
    private javax.swing.JPopupMenu pmnBillSearch;
    private javax.swing.JPanel pnlLookup;
    private javax.swing.JRadioButton radAnd;
    private javax.swing.JRadioButton radOr;
    private javax.swing.JTable tblBill;
    private javax.swing.JTextField txtCustID;
    private javax.swing.JTextField txtGreater;
    private javax.swing.JTextField txtLess;
    // End of variables declaration//GEN-END:variables
}
